<template>
  <div class="block">
    <el-timeline>
      <el-timeline-item v-for="(item,index) of timeline" :key="index" :timestamp="item.key" placement="top">
        <a-card size="small" :title="values.title" v-for="values in item.value" :bordered="false">
          <template #extra>
            <router-link :to="'/articleDetails/'+values.id" target="_blank" class="item-info-oper-text">
              <h4>预览</h4>
            </router-link>
          </template>
          <p>{{ values.abstractText }}</p>
        </a-card>
      </el-timeline-item>
    </el-timeline>
  </div>
</template>

<script>
import {getAction} from "@/api/manage";

export default {
  data() {
    return {
      url: {
        articleTimeAxis: "/article/articleTimeAxis"
      },
      timeline: [
        {
          timestamp: '2019/4/20',
          title: 'Update Github template',
          content: 'PanJiaChen committed 2019/4/20 20:46'
        },
        {
          timestamp: '2019/4/21',
          title: 'Update Github template',
          content: 'PanJiaChen committed 2019/4/21 20:46'
        },
        {
          timestamp: '2019/4/22',
          title: 'Build Template',
          content: 'PanJiaChen committed 2019/4/22 20:46'
        },
        {
          timestamp: '2019/4/23',
          title: 'Release New Version',
          content: 'PanJiaChen committed 2019/4/23 20:46'
        }
      ]
    }
  },
  mounted() {
    this.getArticleTimeAxis()
  },
  methods: {
    getArticleTimeAxis() {
      getAction(this.url.articleTimeAxis, {}).then(res => {
        if (res.success) {
          this.timeline = res.result
        }
      })
    }
  }
}
</script>
<style scoped>
.item-info-oper-text {
  color: #222226;
}

.item-info-oper-text:hover {
  color: #555666
}
</style>
